#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import with_statement
from webpyte.packages.content.model import Post, session

def convert_all_content_to_html():
    for p in Post.all():
        if p.format == 'XHTML': continue
        print 'Converting %i. %s' % (p.id, p.name)
        p.content = p.contentHtml
        p.format = 'XHTML'
    session.commit()
